@extends('layouts.main')

@section('title', '导入物料')

@section('content')
<h3>@yield('title')</h3>
<div class="btn-group" role="group">
  	<a href="{{ action('BusinessData\MaterialController@index') }}" class="btn btn-primary">返回列表</a>
</div>

@if(session('fail'))
<div class="alert alert-warning" role="alert">{{ session('fail') }}</div>
@endif

<form class="form-horizontal" method="post" enctype="multipart/form-data" action="{{ action('BusinessData\MaterialController@import') }}">
    @csrf

    <div class="form-group">
        <label for="upload_file" class="col-sm-2 control-label">导入文件</label>
        <div class="col-sm-6">
            <input type="file" id="upload_file" name="upload_file">
            @if($errors->first('upload_file'))
            <p class="help-block error">{{ $errors->first('upload_file') }}</p>
            @endif
        </div>
    </div>

    <div class="form-group">
		<div class="col-sm-offset-2 col-sm-10">
			<button type="submit" class="btn btn-primary">提交</button>
		</div>
    </div>
  </form>

@endsection